package com.ebs.md.mock.centralrepo;

/**
 * Revision Author:
 *  $File: //depot/MarketData/fxmonitor/main/src/test/java/com/ebs/md/mock/centralrepo/CurrencyPairMock.java $
 *  $Revision: #5 $
 *  $DateTime: 2012/07/22 10:12:12 $
 *  $Change: 112517 $
 *  $Author: Arik.Sher $
 */

import java.math.BigDecimal;
import java.util.Map;

import org.joda.time.DateTime;

import com.ebs.centralrepository.api.Currency;
import com.ebs.centralrepository.api.CurrencyPair;
import com.ebs.centralrepository.api.Precision;
import com.ebs.marketdata.dictionary.InstrumentTypes;
import com.ebs.marketdata.dictionary.PriceContext;


public class CurrencyPairMock
implements CurrencyPair
{
	protected String baseCcy;
	protected String localCcy;
	protected String isoPair;
	protected Precision precision;

	public CurrencyPairMock(String baseCcy, String localCcy) {
		super();
		this.baseCcy = baseCcy;
		this.localCcy = localCcy;
		isoPair = baseCcy + "/" + localCcy;
		createPrecision();
	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((isoPair == null) ? 0 : isoPair.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CurrencyPairMock other = (CurrencyPairMock) obj;
		if (isoPair == null) {
			if (other.isoPair != null)
				return false;
		} else if (!isoPair.equals(other.isoPair))
			return false;
		return true;
	}

	public String getBaseIso() {
		return baseCcy;
	}
	
	public String getLocalIso() {
		return localCcy;
	}

	public String getShortIsoName() {
		return isoPair;
	}

	public String getShortName() {
		return isoPair;
	}

	public void setPrecision(Precision precision) {
		this.precision = precision;
	}
	public Precision getPrecision() {
		return precision;
	}

	protected void createPrecision() {
		short pipEndPos = 4; // default value = 4
		byte  pipType    = PrecisionMock.PIP_TYPE_WHOLE; // default value = PIP_TYPE_WHOLE
		
		if ( "EUR/CHF".equals(isoPair) ) {
			pipEndPos = 4;
			pipType   = PrecisionMock.PIP_TYPE_TENTH;
		}
		if ( "EUR/GBP".equals(isoPair) ) {
			pipEndPos = 5;
			pipType   = PrecisionMock.PIP_TYPE_HALF;
		}
		if ( "EUR/JPY".equals(isoPair) ) {
			pipEndPos = 2;
			pipType   = PrecisionMock.PIP_TYPE_TENTH;
		}
		if ( "EUR/USD".equals(isoPair) ) {
			pipEndPos = 5;
			pipType   = PrecisionMock.PIP_TYPE_TENTH;
		}
		if ( "GBP/USD".equals(isoPair) ) {
			pipEndPos = 4;
			pipType   = PrecisionMock.PIP_TYPE_WHOLE;
		}
		if ( "USD/CHF".equals(isoPair) ) {
			pipEndPos = 4;
			pipType   = PrecisionMock.PIP_TYPE_TENTH;
		}
		// NDF, USD / IDR
		if ( "USD/D01".equals(isoPair) ) {
			pipEndPos = -1;
			pipType   = PrecisionMock.PIP_TYPE_WHOLE;
		}
		if ( "USD/JPY".equals(isoPair) ) {
			pipEndPos = 3;
			pipType   = PrecisionMock.PIP_TYPE_TENTH;
		}
		
		PrecisionMock precisionMock = new PrecisionMock(baseCcy, localCcy, pipEndPos, pipType);
		setPrecision(precisionMock);
	}
	
	public void addDataToStore(Map<String, Object> params, PriceContext pc) {
		throw new UnsupportedOperationException();
		
	}


	public int getAggregateDepth() {
		throw new UnsupportedOperationException();
		
	}


	public String getBase() {
		throw new UnsupportedOperationException();
		
	}


	public String getBase(int appType) {
		throw new UnsupportedOperationException();
		
	}


	public Currency getBaseCurrency() {
		throw new UnsupportedOperationException();
		
	}


	public int getBaseId() {
		throw new UnsupportedOperationException();
		
	}

	public boolean getConfigParamEnabled() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getDefaultMaxTradeSizeHit() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getDefaultMaxTradeSizeQuote() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getDefaultTradeSizeHit() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getDefaultTradeSizeQuote() {
		throw new UnsupportedOperationException();
		
	}


	public String getDisplayName() {
		throw new UnsupportedOperationException();

	}


	public byte getEODOffsetAfterChange() {
		throw new UnsupportedOperationException();
		
	}


	public byte getEODOffsetBeforeChange() {
		throw new UnsupportedOperationException();
		
	}


	public DateTime getEODTimeChange() {
		throw new UnsupportedOperationException();
		
	}


	public String getFIXTenor() {
		throw new UnsupportedOperationException();
		
	}


	public boolean getForceLongForm() {
		throw new UnsupportedOperationException();
		
	}


	public InstrumentTypes getInstrument() {
		throw new UnsupportedOperationException();
		
	}


	public String getInstrumentName() {
		throw new UnsupportedOperationException();
		
	}


	public int getInstrumentSubType() {
		throw new UnsupportedOperationException();
		
	}


	public byte getInterveningDays() {
		throw new UnsupportedOperationException();
		
	}


	public String getLocal() {
		throw new UnsupportedOperationException();
		
	}


	public String getLocal(int appType) {
		throw new UnsupportedOperationException();
		
	}


	public Currency getLocalCurrency() {
		throw new UnsupportedOperationException();
		
	}


	public int getLocalId() {
		throw new UnsupportedOperationException();
		
	}



	public long getLotSize() {
		throw new UnsupportedOperationException();
		
	}


	public int getMaxOrderAmount() {
		throw new UnsupportedOperationException();
		
	}


	public int getMinOrderAmount() {
		throw new UnsupportedOperationException();
		
	}


	public String getNearTenor() {
		throw new UnsupportedOperationException();
		
	}


	public String getPairGroupName() {
		throw new UnsupportedOperationException();
		
	}


	public int getPairId() {
		throw new UnsupportedOperationException();
		
	}


	public int getPipType() {
		throw new UnsupportedOperationException();
		
	}



	public BigDecimal getPriceAggregationRange() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getRegularAmount() {
		throw new UnsupportedOperationException();
		
	}


	public byte getRollOverDays() {
		throw new UnsupportedOperationException();
		
	}


	public String getShortCut() {
		throw new UnsupportedOperationException();
		
	}


	public String getShortName(int appType) {
		throw new UnsupportedOperationException();
		
	}


	public byte getSpreadOffsetOverride() {
		throw new UnsupportedOperationException();
		
	}


	public String getTenor() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeIncrementHit() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeIncrementQuote() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeMaximumHit() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeMaximumQuote() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeMinimumHit() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeMinimumQuote() {
		throw new UnsupportedOperationException();
		
	}


	public BigDecimal getTradeSizeUnit() {
		throw new UnsupportedOperationException();
		
	}


	public boolean getUseBaseAmount() {
		throw new UnsupportedOperationException();
		
	}


	public int getVersion() {
		throw new UnsupportedOperationException();
		
	}


	public byte getVoiceDefinition() {
		throw new UnsupportedOperationException();
		
	}


	public String getXMLTenor() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isFXSwapPair() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isMetal() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isMktActive() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isNdfSwapPair() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isNegativePriceAllowed() {
		throw new UnsupportedOperationException();
		
	}


	public boolean isTenored() {
		throw new UnsupportedOperationException();
		
	}


	public void setPipType(int pipType) {
		throw new UnsupportedOperationException();
		
	}

}
